<!--
 * @FilePath     : /study_code/vue2.x/plugin.html
 * @Description  : 自封装一个 vue 插件
 * @Date         : 2025-05-03 09:54:37
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-05-03 09:54:37
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="" />
  </head>
  <body>
    <div id="app">
      <input type="text" v-focus />
    </div>

    <script src="/vue/dist/vue.min.js"></script>
    <script src="./common.js"></script>
    <script>
      // （new Vue 实例化之前）注册插件
      Vue.use(MyPlugin)

      var vm = new Vue({
        el: '#app',
        data: function () {
          return {}
        },
        created() {
          console.log('访问全局属性', Vue.myGlobalProperty)
          // 调用全局方法
          Vue.myGlobalMethod()
          // 调用实例上方法
          this.$myMethod()
        },
      })
    </script>
  </body>
</html>
